#ifndef SERIAL_COMM_H_
#define SERIAL_COMM_H_

#define SUCCESS_COMM 1
#define FAILURE_COMM 0

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#include <string.h>
#include <vector>

#include <fcntl.h>
#include <termios.h>
#include <sys/ioctl.h>

class SerialComm{
 public:
  // Constructor
  SerialComm(const char* port, int baud);

  // Destructor
  ~SerialComm(){}

  // Method
  int sendString(unsigned char* input, int length);
  int readString(unsigned char** buff, char end);

  // Accessor
  bool isValid(void);
 protected:
  // Fields
  const char * portName;
  bool valid;
  speed_t brate;
  int fd;
  
};
#endif 
